﻿package mortal.game.view.copy.groupCopy.view
{
    import com.mui.controls.*;
    import com.mui.utils.*;
    import extend.language.*;
    import flash.text.*;
    import mortal.common.global.*;
    import mortal.game.view.common.*;
    import mortal.game.view.common.alertwins.*;

    public class GroupCopyLeaveWin extends CustomAlertWin
    {
        protected var _leftTime:SecTimerView;
        protected var _txt:GTextFiled;

        public function GroupCopyLeaveWin(param1:Number, param2:Number)
        {
            super(param1, param2);
            return;
        }// end function

        override protected function createChildren() : void
        {
            super.createChildren();
            this._txt = UICompomentPool.getUICompoment(GTextFiled);
            this._txt.defaultTextFormat = GlobalStyle.textFormatPutong;
            this._txt.x = 108;
            this._txt.y = 100;
            this._txt.text = "" + Language.getString(70899);
            this._txt.mouseEnabled = false;
            this._leftTime = UICompomentPool.getUICompoment(SecTimerView);
            this._leftTime.x = 78;
            this._leftTime.y = 100;
            this._leftTime.autoSize = TextFieldAutoSize.LEFT;
            this._leftTime.defaultTextFormat = GlobalStyle.textFormatPutong;
            this._leftTime.mouseEnabled = false;
            this._leftTime.setParse("" + Language.getString(70900));
            this._leftTime.setLeftTime(5);
            this._leftTime.timeOutHandler = this.onSecViewTimeChangeHandler;
            this._leftTime.mouseEnabled = false;
            return;
        }// end function

        override protected function layoutAllUI() : void
        {
            super.layoutAllUI();
            prompt.addChild(this._leftTime);
            prompt.addChild(this._txt);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            return;
        }// end function

        private function onSecViewTimeChangeHandler() : void
        {
            if (closeHandler != null)
            {
                if (extendObj != null)
                {
                    closeHandler(Alert.OK, extendObj);
                }
                else
                {
                    closeHandler(Alert.OK);
                }
            }
            this.parent.removeChild(this);
            return;
        }// end function

    }
}
